package concurrent.year2021;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class ThreadStateTest4 {


    public static void main(String[] args) throws InterruptedException {


//        TimeUnit.DAYS.sleep(10); // TIMED_WAITING
        Lock l1 = new ReentrantLock();
        Condition c = l1.newCondition();
        new Thread(()->{
            l1.lock();
            try {
                TimeUnit.DAYS.sleep(3); // TIMED_WAITING
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
        TimeUnit.SECONDS.sleep(3);
        l1.tryLock(10, TimeUnit.DAYS); // TIMED_WAITING

    }

}
